package com.xm.zcf.service.product.impl;

import com.xm.zcf.dao.product.ProductDao;
import com.xm.zcf.domain.product.Product;
import com.xm.zcf.service.product.ProductService;
import com.xm.zcf.util.PageBean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/3/20.
 */
@Service
@Transactional
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductDao productDao;
    @Override
    public List<Product> findAll() {
        return productDao.findAll();
    }

    @Override
    public PageBean<Product> findPage(Integer page, Integer limit) {
        return productDao.findPage(page,limit);
    }

    @Override
    public Product findById(int pid) {
        return productDao.findById(pid);
    }

    @Override
    public void save(Product model) {
        productDao.save(model);
    }

    @Override
    public List<Product> findHotProduct(int i) {
        return productDao.findHotProduct(i);
    }

    @Override
    public List<Product> findNewProducts(int i) {
        return productDao.findNewProducts(i);
    }

    @Override
    public PageBean<Product> findPageBean(Integer page, Integer limit, Integer cid) {
        return productDao.findPageBean(page,limit,cid);
    }

    @Override
    public Product findByPid(Integer id) {
        return productDao.findByPid(id);
    }

    @Override
    public PageBean<Product> findCsPageBean(Integer page, Integer limit, Integer csid) {
        return productDao.findCsPageBean(page,limit,csid);
    }
}
